package pack_ie;

import java.io.File;
import java.util.List;
import java.util.concurrent.TimeUnit;

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;

import org.openqa.selenium.ie.InternetExplorerDriver;
import org.testng.annotations.Test;
public class Exon_ie {
	public static WebDriver driver; 
	public static String url="http://205.138.114.152:101/products/cmptrck3ra/index.aspx";
	
	
	@Test
	public void startWebDriver() throws InterruptedException{

		
		File file = new File("C:\\Users\\IEDriverServer.exe");
		System.setProperty("webdriver.ie.driver", file.getAbsolutePath());
		
		 driver = new InternetExplorerDriver();
		
	driver.get(url);
	driver.manage().window().maximize();
	driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
	
	
		
    List<WebElement> link_tabs= driver.findElement(By.id("bdyCopyHdr")).findElements(By.tagName("em"));    //xpath("//*[@id='bdyCopyHdr']")).findElements(By.tagName("em"));
	
	int a = link_tabs.size();
	for(int i=0; i<a; i++){
			
	//print the link text
	System.out.println(link_tabs.get(i).getText());
	Thread.sleep(2000);
	//click the link
											
	link_tabs.get(i).click();
		
	}
	Thread.sleep(2000);
	driver.navigate().to(url);
	
	
	}
}
